<template>
  <div class="Left2Chart">
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
import {let2Data} from '@/utils/data';
export default {
  data () {
    return {
      cdata: {
        xData: [],
        seriesData: []
      }
    }
  },
  components: {
    Chart,
  },
  mounted () {
    this.getData();
  },
  methods: {
    // 获取数据
    getData(){
      let2Data.forEach(element => {
        this.cdata.xData.push(element.name);
      });
      this.cdata.seriesData = let2Data
    }
  }
}
</script>

<style lang="scss" scoped>
.Left2Chart{
  width: 100%;
  height: 100%;
  >div{
    width: 100%;
    height: 100%;
  }
}
</style>